/**
 * Created by zhaoxk on 2016/11/14.
 */
import React from 'react';
import { Input, Col, Form } from 'antd';
const FormItem = Form.Item;

export default class RemarkInput extends React.Component {
    render() {
        const _this = this,
            {getFieldDecorator} = _this.props.form,
            tid = _this.props.tid,
            i = _this.props.i,
            _name = `${_this.props.tid}_remark_${i}`,
            props = getFieldDecorator(_name, {
                initialValue: this.props.value,
                onChange(v) {
                    _this.props.updateValue(
                        {
                            value: v,
                            tid,
                            i,
                            name: 'remark'
                        }
                    );
                }
            });
        return (
            <Col
                key={i}
                {...RemarkInput.size}
                style={{
                    float: 'none',
                    clear: 'both'
                }}
            >
                <div
                    style={{
                        padding: '0 5px'
                    }}
                >
                    <FormItem
                        label="备注"
                        style={{
                            position: 'relative'
                        }}
                    >
                        {props(<Input
                            type="textarea"
                            placeholder="请填写备注"
                        />)}
                    </FormItem>
                </div>
            </Col>
        );
    }
}
RemarkInput.size = {
    xs: {
        span: 24
    },
    sm: {
        span: 24
    },
    md: {
        span: 24
    },
    lg: {
        span: 24
    }
};
